// [[ OnflowGenerator File UUID: e632bd0c67d84bda8188ddac68daaedd  ]]
package com.itdct.onflow.system.monitor.controller

import com.itdct.onflow.core.type.*
import com.itdct.onflow.core.vo.RespPageVo
import com.itdct.onflow.core.vo.RespVo
import com.itdct.onflow.system.common.base.BaseSysController
import com.itdct.onflow.system.monitor.qo.SysMachineReportEditQo
import com.itdct.onflow.system.monitor.qo.SysMachineReportSearchQo
import com.itdct.onflow.system.monitor.service.SysMachineReportService
import com.itdct.onflow.system.monitor.vo.SysMachineReportDetailVo
import com.itdct.onflow.system.monitor.vo.SysMachineReportListVo
import io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotations.tags.Tag
import org.springframework.http.MediaType
import org.springframework.validation.annotation.Validated
import org.springframework.web.bind.annotation.*

/**
 * @author DCTANT
 * @date 2025-10-16 09:59:44
 * @version 1.0
 * @description 服务器监控数据上报接口控制
 */
@Tag(name = SysMachineReportController.moduleName)
@RestController
@RequestMapping(value = ["/sysMachineReport"], produces = [MediaType.APPLICATION_JSON_VALUE], method = [RequestMethod.POST])
class SysMachineReportController(
    val sysMachineReportService: SysMachineReportService
) : BaseSysController() {
    companion object {
        const val moduleName = "服务器监控数据上报"
    }

    @Operation(summary = moduleName + "添加")
    @PostMapping("/add.adw")
    fun add(@RequestBody @Validated(Add::class) qo: SysMachineReportEditQo): RespVo<Long> {
        return sysMachineReportService.add(qo, getContext())
    }

    @Operation(summary = moduleName + "更新")
    @PostMapping("/update.adw")
    fun update(@RequestBody @Validated(Update::class) qo: SysMachineReportEditQo): RespVo<Unit> {
        return sysMachineReportService.update(qo, getContext())
    }

    @Operation(summary = moduleName + "删除")
    @PostMapping("/delete.adw")
    fun delete(@RequestBody @Validated(Delete::class) qo: SysMachineReportEditQo): RespVo<Unit> {
        return sysMachineReportService.delete(qo, getContext())
    }

    @Operation(summary = moduleName + "详情")
    @PostMapping("/detail.adw")
    fun detail(@RequestBody @Validated(Detail::class) qo: SysMachineReportSearchQo): RespVo<SysMachineReportDetailVo> {
        return sysMachineReportService.detail(qo, getContext())
    }

    @Operation(summary = moduleName + "列表")
    @PostMapping("/page.adw")
    fun page(@RequestBody @Validated(Page::class) qo: SysMachineReportSearchQo): RespPageVo<SysMachineReportListVo> {
        return sysMachineReportService.page(qo, getContext())
    }

    @Operation(summary = moduleName + "获取折线图信息")
    @PostMapping("/getLineChart.adw")
    fun getLineChart(@RequestBody qo: SysMachineReportSearchQo): RespVo<List<SysMachineReportListVo>> {
        return sysMachineReportService.getLineChart(qo, getContext())
    }

// [[ OnflowGenerator Range (- selectFunctions -) Start ]]

// [[ OnflowGenerator Range (- selectFunctions -) End ]]
}